package apis.youtube
{
	import flash.events.EventDispatcher;
	import flash.events.Event;
	import flash.events.ErrorEvent;
	import flash.events.HTTPStatusEvent;
	import flash.net.URLLoader;

	public class YouTubeConnector extends EventDispatcher
	{
		

		
		public function get datas() : XML {
			return _datas;
		}
		
		
		
		//_______________________________________________________________________
		//																PRIVATES
		
		
		protected function onComplete( e : Event ) : void {
			 var l : URLLoader = e.target as URLLoader;
			 _datas = XML( l.data );
			 
			 parseDatas( );
		}
		protected function onError( e : ErrorEvent ) : void {
			 trace( e.text );
		}
		protected function onHttpStatus( e : HTTPStatusEvent ) : void {
			 trace( e.status );
		}
		
		protected function parseDatas() : void {
			dispatchEvent( new Event( Event.COMPLETE ) );
		}
		
		protected var _datas : XML;

	}
}